package org.example.erp.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 
 * @TableName sales
 */
@TableName(value ="sales")
@Data
public class Sales implements Serializable {
    /**
     * 
     */
    @TableId(type = IdType.AUTO)
    private Integer salesId;

    /**
     * 出库单编号
     */
    private String salesCodes;

    /**
     * 出库单名称
     */
    private String salesOutboundName;

    /**
     * 销售订单编号
     */
    private Integer soId;

    /**
     * 客户id
     */
    private Integer customerId;

    /**
     * 出库时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date salesDate;

    /**
     * 状态 0/1
     */
    private Integer status;

    /**
     * 备注
     */
    private String remark;

    /**
     * 类型
     */
    private String salesType;

    /**
     * 备用列2
     */
    private String column2;

    /**
     * 备用列3
     */
    private String column3;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
    @TableField(exist = false)
    List<WmProductSalseLine> list; // 子表信息
    @TableField(exist = false)
    private SalesOrder salesOrder;
    @TableField(exist = false)

    private Customer customer;
    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Sales other = (Sales) that;
        return (this.getSalesId() == null ? other.getSalesId() == null : this.getSalesId().equals(other.getSalesId()))
            && (this.getSalesCodes() == null ? other.getSalesCodes() == null : this.getSalesCodes().equals(other.getSalesCodes()))
            && (this.getSalesOutboundName() == null ? other.getSalesOutboundName() == null : this.getSalesOutboundName().equals(other.getSalesOutboundName()))
            && (this.getSoId() == null ? other.getSoId() == null : this.getSoId().equals(other.getSoId()))
            && (this.getCustomerId() == null ? other.getCustomerId() == null : this.getCustomerId().equals(other.getCustomerId()))
            && (this.getSalesDate() == null ? other.getSalesDate() == null : this.getSalesDate().equals(other.getSalesDate()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
            && (this.getSalesType() == null ? other.getSalesType() == null : this.getSalesType().equals(other.getSalesType()))
            && (this.getColumn2() == null ? other.getColumn2() == null : this.getColumn2().equals(other.getColumn2()))
            && (this.getColumn3() == null ? other.getColumn3() == null : this.getColumn3().equals(other.getColumn3()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getSalesId() == null) ? 0 : getSalesId().hashCode());
        result = prime * result + ((getSalesCodes() == null) ? 0 : getSalesCodes().hashCode());
        result = prime * result + ((getSalesOutboundName() == null) ? 0 : getSalesOutboundName().hashCode());
        result = prime * result + ((getSoId() == null) ? 0 : getSoId().hashCode());
        result = prime * result + ((getCustomerId() == null) ? 0 : getCustomerId().hashCode());
        result = prime * result + ((getSalesDate() == null) ? 0 : getSalesDate().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        result = prime * result + ((getSalesType() == null) ? 0 : getSalesType().hashCode());
        result = prime * result + ((getColumn2() == null) ? 0 : getColumn2().hashCode());
        result = prime * result + ((getColumn3() == null) ? 0 : getColumn3().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", salesId=").append(salesId);
        sb.append(", salesCodes=").append(salesCodes);
        sb.append(", salesOutboundName=").append(salesOutboundName);
        sb.append(", soId=").append(soId);
        sb.append(", customerId=").append(customerId);
        sb.append(", salesDate=").append(salesDate);
        sb.append(", status=").append(status);
        sb.append(", remark=").append(remark);
        sb.append(", salesType=").append(salesType);
        sb.append(", column2=").append(column2);
        sb.append(", column3=").append(column3);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}